<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

	<head>
		<title>销售机会管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="../css/style.css" rel="stylesheet" type="text/css">
		<script src="../script/common.js"></script>
		<script type="text/javascript" src="../../js/jquery-3.3.1.min.js"></script>
		<link href="../css/layui.css" rel="stylesheet" type="text/css">
		<script type="text/javascript" src="../../js/vue.min.js"></script>
		<script src="../../js/layui/layui.js"></script>
	</head>

	<body>
		<div class="page_title">销售机会管理</div>
		<div class="button_bar">
			<!--<button class="common_button" id="help" onclick="add('~sale/add.html')" >帮助</button>-->
			<button class="layui-btn layui-btn-normal" onclick="add('~sale/add.html')">新建</button>
			<!--查询的方法需要重新写-->
			<button class="layui-btn layui-btn-normal" onclick="changes('~sale/list.html')">查询</button>
		</div>
			<div id="app" class="layui-form">
				<table class="query_form_table">
					<tr>
						<th>客户名称</th>
						<td><input type="text" placeholder="请输入客户名称" class="layui-input"></td>
						<th>概要</th>
						<td><input type="text" placeholder="请输入概要" class="layui-input"></td>
						<th>联系人</th>
						<td>
							<input type="text" placeholder="请输入联系人姓名" class="layui-input">
						</td>
					</tr>
				</table>
				<br />
				<table class="layui-table">
					<tr>
						<th>编号</th>
						<th>客户名称</th>
						<th>概要</th>
						<th>联系人</th>
						<th>联系人电话</th>
						<th>创建时间</th>
						<th>操作</th>
					</tr>
					<tr>
						<td class="list_data_number">1</td>
						<td class="list_data_text">睿智数码</td>
						<td class="list_data_ltext">采购笔记本电脑意向</td>
						<td class="list_data_text">刘先生</td>
						<td class="list_data_text">13729239239</td>
						<td class="list_data_text">2007年12月06日</td>
						<td class="list_data_op">
							<button class="layui-btn layui-btn-normal" onclick="to('~sale/dispatch.html');"><img title="指派" src="../images/指派32.png"/>指派</button>
							<button class="layui-btn layui-btn-normal" onclick="to('~sale/edit.html')"><img title="编辑" src="../images/编辑232.png"/>编辑</button>
							<!--删除时需要判断当前登录用户为该销售机会的创建人，否则不可删除。-->
							<button class="layui-btn layui-btn-normal"><img title="删除" src="../images/删 除.png"/>删除</button>
						</td>
					</tr>
				</table>
				<div class="change_page" style="float: right; margin-right: 20px;">
					<table lay-skin="nob">
						<tr>
							<td><button class="layui-btn layui-btn-primary" v-on:click="querypage('1')">首页</button></td>
							<td><button class="layui-btn layui-btn-primary" v-on:click="querypage('-')">上一页</button>&nbsp;&nbsp;</td>
							<td>
								<input type="text" required lay-verify="required" class="layui-input" style="width: 30px;" v-model="pages">
							</td>
							<td>
								<label>/{{sumpages}}</label>
								<button class="layui-btn layui-btn-primary" v-on:click="querypage('0')">跳转</button>
							</td>
							<td><button class="layui-btn layui-btn-primary" v-on:click="querypage('+')">下一页</button></td>
							<td><button class="layui-btn layui-btn-primary" v-on:click="querypage('2')">末页</button></td>
						</tr>
					</table>
				</div>
			</div>
	</body>

</html>

<script>
	layui.use(['form', 'laydate'], function() {
		var form = layui.form;
		var laydate = layui.laydate;
	});
</script>
<script>
	function changes(str) {
		parent.document.getElementById("mywork").src = str;
	}
	new Vue({
		el: "#app",
		data: {
			pages: 1,
			sumpages: 25
		},
		methods: {
			querypage: function(str) {
				var pages = this.pages;
				switch(str) {
					case '+':
						if(eval(pages + "+" + 1) <= this.sumpages) {
							this.pages = eval(pages + "+" + 1);
						}
						break;
					case '-':
						if(eval(pages + "-" + 1) >= 1) {
							this.pages = eval(pages + "-" + 1);
						}
						break;
					case '0':
						break;
					case '1':
						this.pages = 1;
						break;
					case '2':
						this.pages = this.sumpages;
						break;
					default:
						break;
				}
			}
		}
	})
</script>